package com.ying.dogying.im.handler.filter;

import org.tio.core.ChannelContext;
import org.tio.core.ChannelContextFilter;

public class ExcludeMineChannelContextFilter implements ChannelContextFilter {

    private ChannelContext currentContext;

    @Override
    public boolean filter(ChannelContext channelContext) {

        // 过滤当前用户，不需要发送消息
        if(currentContext.userid.equals(channelContext.userid)) {
            return false;
        }
        return true;
    }

    public ChannelContext getCurrentContext() {
        return currentContext;
    }

    public void setCurrentContext(ChannelContext currentContext) {
        this.currentContext = currentContext;
    }
}